package com.gcsj.gcsjspringboot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.gcsj.gcsjspringboot.common.validator.group.AddGroup;
import com.gcsj.gcsjspringboot.common.validator.group.UpdateGroup;
import lombok.Data;
import nonapi.io.github.classgraph.json.Id;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 系统员工
 *
 * @author
 */
@TableName("sys_user")
@Data
public class SysUserEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 员工ID
	 */
	@TableId(type = IdType.AUTO)
	private Long userId;

	/**
	 * 员工名
	 */
	@lombok.Getter
	@NotBlank(message="员工登录名不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String username;
	/**
	 * 员工名
	 */
	@NotBlank(message="员工姓名不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String name;
	/**
	 * 密码
	 */
	@NotBlank(message="密码不能为空", groups = AddGroup.class)
	@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
	private String password;

	/**
	 * 盐
	 */
	@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
	private String salt;

	/**
	 * 邮箱
	 */
	private String email;

	/**
	 * 手机号
	 */
	private String mobile;
	private String sex;
	/**
	 * 状态  0：禁用   1：正常
	 */
	private Integer status;

	/**
	 * 角色ID列表
	 */
	@TableField(exist=false)
	private List<Long> roleIdList;

	/**
	 * 创建时间
	 */
	private Date createTime;

	/**
	 * 部门ID
	 */
//	@NotNull(message="部门不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private Long deptId;
	private Float jxScore;
	private String entryDate;
	private Float mustSalary;

	/**
	 * 部门名称
	 */
	@TableField(exist=false)
	private String deptName;

}
